package com.znsb.mxk.download;

import android.os.Parcel;
import android.os.Parcelable;

public class UpdateAppBean implements Parcelable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/** 表示是否为强制升级（0否，1是） **/
	private int forceupdate;
	/** 只有在WiFi情况下才更新 **/
	private boolean updateInWifi = true;
	/** 下载完后是否自动安装 **/
	private boolean isAutoInstallOnDownloaded = true;
	/** 是否在通知栏里显示下载的进度 **/
	private boolean isShowLoadingNotifiaction = true;
	/**是否发送下载进度**/
	private boolean isSendDownloadProgress=false;
	/** 新版本app版本号 **/
	private int versionCode = -1;
	/** 新版本特征描述 **/
	private String desc;
	/** 新版本下载地址 **/
	private String url;

	public int getForceupdate() {
		return forceupdate;
	}

	public void setForceupdate(int forceupdate) {
		this.forceupdate = forceupdate;
	}

	public String getDesc() {
		return desc;
	}

	public boolean isUpdateInWifi() {
		return updateInWifi;
	}

	public void setUpdateInWifi(boolean updateInWifi) {
		this.updateInWifi = updateInWifi;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public int getVersionCode() {
		return versionCode;
	}

	public void setVersionCode(int versionCode) {
		this.versionCode = versionCode;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public boolean isAutoInstallOnDownloaded() {
		return isAutoInstallOnDownloaded;
	}

	public void setAutoInstallOnDownloaded(boolean isAutoInstallOnDownloaded) {
		this.isAutoInstallOnDownloaded = isAutoInstallOnDownloaded;
	}

	public boolean isShowLoadingNotifiaction() {
		return isShowLoadingNotifiaction;
	}

	public void setShowLoadingNotifiaction(boolean isShowLoadingNotifiaction) {
		this.isShowLoadingNotifiaction = isShowLoadingNotifiaction;
	}

	public boolean isSendDownloadProgress() {
		return isSendDownloadProgress;
	}

	public void setSendDownloadProgress(boolean isSendDownloadProgress) {
		this.isSendDownloadProgress = isSendDownloadProgress;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(this.forceupdate);
		dest.writeByte(this.updateInWifi ? (byte) 1 : (byte) 0);
		dest.writeByte(this.isAutoInstallOnDownloaded ? (byte) 1 : (byte) 0);
		dest.writeByte(this.isShowLoadingNotifiaction ? (byte) 1 : (byte) 0);
		dest.writeByte(this.isSendDownloadProgress ? (byte) 1 : (byte) 0);
		dest.writeInt(this.versionCode);
		dest.writeString(this.desc);
		dest.writeString(this.url);
	}

	public UpdateAppBean() {
	}

	protected UpdateAppBean(Parcel in) {
		this.forceupdate = in.readInt();
		this.updateInWifi = in.readByte() != 0;
		this.isAutoInstallOnDownloaded = in.readByte() != 0;
		this.isShowLoadingNotifiaction = in.readByte() != 0;
		this.isSendDownloadProgress = in.readByte() != 0;
		this.versionCode = in.readInt();
		this.desc = in.readString();
		this.url = in.readString();
	}

	public static final Creator<UpdateAppBean> CREATOR = new Creator<UpdateAppBean>() {
		@Override
		public UpdateAppBean createFromParcel(Parcel source) {
			return new UpdateAppBean(source);
		}

		@Override
		public UpdateAppBean[] newArray(int size) {
			return new UpdateAppBean[size];
		}
	};
}
